import re

# 使用命名捕获组
pattern = r'(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})'
text = "2023-12-14"

# 执行匹配
match = re.match(pattern, text)
if match:
    # 通过组名来获取匹配的内容
    print(f"Year: {match.group('year')}")   # 输出：Year: 2023
    print(f"Month: {match.group('month')}") # 输出：Month: 12
    print(f"Day: {match.group('day')}")     # 输出：Day: 14
